﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace DCT.View
{
    /// <summary>
    /// ProjectManager.xaml 的交互逻辑
    /// </summary>
    public partial class ProjectManager : UserControl
    {
        public ProjectManager()
        {
            InitializeComponent();
        }

        private void TreeViewItem_PreviewMouseRightButtonDown(object sender, MouseEventArgs e)
        {
            DependencyObject item = e.OriginalSource as DependencyObject;

            while (item != null && !(item is TreeViewItem))
            {
                item = VisualTreeHelper.GetParent(item);
            }

            if (item != null)
            {
                (item as TreeViewItem).Focus();
                e.Handled = true;
            }
        }
    }
}
